//
//  GSCustomNavigationBar.m
//  GameSky
//
//  Created by lanou on 16/1/12.
//  Copyright © 2016年 NiRongfei. All rights reserved.
//

#import "GSCustomNavigationBar.h"

#define kButtonWidth 44
#define kMargin 10

@implementation GSCustomNavigationBar

- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        // 夜间模式
        self.dk_backgroundColorPicker = DKColorWithColors(kNavBarColor, [UIColor blackColor]);
        
        self.leftButton = [[UIButton alloc] initWithFrame:CGRectMake(kMargin, kHeight - kButtonWidth, kButtonWidth, kButtonWidth)];
        [self addSubview:self.leftButton];
        
        self.rightButton = [[UIButton alloc] initWithFrame:CGRectMake(kWidth - kButtonWidth - kMargin, kHeight - kButtonWidth, kButtonWidth, kButtonWidth)];
        [self addSubview:self.rightButton];
        
        self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(kButtonWidth, kHeight - kButtonWidth, kWidth - (kButtonWidth + kMargin) * 2, kButtonWidth)];
        self.titleLabel.textColor = [UIColor whiteColor];
        self.titleLabel.textAlignment = NSTextAlignmentCenter;
        [self addSubview:self.titleLabel];
    }
    return self;
}

@end
